Since handheld devices with digital camera function are widely used, the image data security is getting more and more important. Private images may be disclosed when the handheld device is lost, stolen, repaired, or borrowed. The existing image data encryption technique usually needs a computer to add some identification codes in the header of JPEG image through software, for example. This method is not secure enough. Confidential or private images may be disclosed due to man-made mistakes or device lost. Further, the existing methods have the following defects: (1) the way to encrypt the JPEG headers may cause the whole image cannot be opened; (2) the image cannot be blurred; (3) the captured images cannot be encrypted instantly.